<template>
  <div id="goods">
    <div class="tou">
      <div class="left">
        <p>全部商品</p>
        <p>为你优选</p>
      </div>
      <div class="right">
        <p>鲜果现切</p>
        <p>贴心下午茶</p>
      </div>
    </div>
    <div class="box">
      <div class="sbox" v-for="(v, i) in arr" :key="i">
        <img :src="v.urlimg" alt="" />
        <div class="bottom">
          <p>{{ v.title }}</p>
          <p>{{ v.save }}</p>
          <h4>
            <div>
              <p>{{ v.jg }}</p>
              <p v-if="v.dazhec != null"><img :src="v.uimg" alt="" /></p>
              <p v-else class="dazhes">
              <img :src="v.dazhec" alt="" />
              </p>
            </div>
            <a href="" class="iconfont icon-gouwugouwuchedinggou"></a>
          </h4>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import axios from "@/apis/api.js"
export default {
  data(){
    return{
      arr:[]
    };
  },
  created(){
    axios("/data/list/shouye").then((ok)=>{
      console.log(ok.data.data);
        this.arr=ok.data.data
    })
  }





  // data() {
  //   return {
  //     arr: [
  //       {
  //         title: "沃柑（中）1份/500g",
  //         save: "皮薄肉满汁多，几乎是纯...",
  //         urlimg: require("@/assets/shouye/111.jpg"),
  //         jg: "￥19.9",
  //         uimg: require("@/assets/shouye/xinxiang.png"),
  //         dimg: "",
  //       },
  //       {
  //         title: "红宝玉草莓（大）1份约250g",
  //         save: "皮薄肉满汁多，几乎是纯...",
  //         urlimg: require("@/assets/shouye/caomeis.jpg"),
  //         jg: "￥19.9",
  //         uimg: require("@/assets/shouye/xinxiang.png"),
  //         dimg: "",
  //       },
  //       {
  //         title: "丝蒂冷冻去核榴莲肉1盒/约100g",
  //         save: "皮薄肉满汁多，几乎是纯...",
  //         urlimg: require("@/assets/shouye/3333.jpg"),
  //         jg: "￥19.9",
  //         uimg: "",
  //         dimg: require("@/assets/shouye/dazhe.jpg"),
  //       },
  //       {
  //         title: "红宝玉草莓（大）1份/约1kg",
  //         save: "皮薄肉满汁多，几乎是纯...",
  //         urlimg: require("@/assets/shouye/222.jpg"),
  //         jg: "￥79.8",
  //         uimg: require("@/assets/shouye/xinxiang.png"),
  //         dimg: "",
  //       },
  //       {
  //         title: "洛川富士苹果（小）1份/约1.3kg",
  //         save: "皮薄肉满汁多，几乎是纯...",
  //         urlimg: require("@/assets/shouye/pingguo.jpg"),
  //         jg: "￥12.5",
  //         uimg: require("@/assets/shouye/xinxiang.png"),
  //         dimg: "",
  //       },
  //       {
  //         title: "粑粑柑（中）1份/约450g",
  //         save: "又名春见，果大皮薄",
  //         urlimg: require("@/assets/shouye/juzi.jpg"),
  //         jg: "￥7.9",
  //         uimg: require("@/assets/shouye/xinxiang.png"),
  //         dimg: "",
  //       },
  //       {
  //         title: "大金煌芒 1份/约1.3kg",
  //         save: "皮薄肉满汁多，几乎是纯...",
  //         urlimg: require("@/assets/shouye/mangguo.jpg"),
  //         jg: "￥61.1",
  //         uimg: require("@/assets/shouye/xinxiang.png"),
  //         dimg: "",
  //       },
  //     ],
  //   };
  // },
};
</script>

<style  scoped>
#goods {
  width: 100%;
  min-height: 15rem;
  background: rgb(227, 227, 227);
}
.tou {
  height: .6rem;
  display: flex;
  text-align: center;
  padding-top: 10px;
}
.tou .left {
  color: rgb(68, 155, 75);
  font-weight: 600;
  flex: 1;
  border-right: 1px solid rgba(128, 128, 128, 0.295);
}
.tou .left p:nth-child(1) {
  font-size: 0.2rem;
}
.tou .left p:nth-child(2) {
  font-size: 0.14rem;
  background: rgb(104, 205, 109);
  color: white;
  width: 0.75rem;
  border-radius: 0.09rem;
  margin-left: 0.56rem;
}
.tou .right {
  font-weight: 600;
  flex: 1;
}
.tou .right p:nth-child(1) {
  font-size: 0.2rem;
}
.tou .right p:nth-child(2) {
  font-size: 0.14rem;
  text-align: center;
  color: gray;
}

.box {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
.sbox {
  width: 49.5%;
  height: 3.2rem;
  border-radius: 0.08rem;
  background: white;
  position: relative;
  z-index: 1;
  margin-top: 0.1rem;
}
.sbox img {
  margin-left: 0.05rem;
  margin-top: 0.05rem;
  width: 1.8rem;
  height: 1.8rem;
}
.sbox .bottom {
  margin-left: 0.1rem;
}
.sbox .bottom p:nth-child(1) {
  font-weight: 600;
}
.sbox .bottom p:nth-child(2) {
  font-size: 0.14rem;
  color: rgb(195, 195, 195);
}
.sbox .bottom h4 {
  color: red;
  width: 0.8rem;
  position: absolute;
  bottom: 0.1rem;
}
.sbox .bottom h4 img {
  width: 0.6rem;
  height: 0.18rem;
}
.sbox .bottom h4 a {
  color: green;
  font-size: 0.3rem;
  width: 0.5rem;
  margin-left: 0.65rem;
  margin-top: 0.1rem;
  position: absolute;
  bottom: -0.25rem;
  left: 0.55rem;
}
.dazhes{
  text-decoration: line-through;
}
</style>